<?php
/**
 * Created by PhpStorm.
 * User: seven
 * Date: 2018/2/4
 * Time: 下午10:51
 */

//echo "fuck<hr/>";

//use TopClient;
//use AlibabaAliqinFcSmsNumSendRequest;

class SmsUtils{

    public static function sendSms($phone, $code){

        $accessKeyId = "24781099";
        $accessKeySecret = "c6c8723ae999706d2075aba51f2ca765";
        $c = new TopClient;
        $c->appkey = $accessKeyId;
        $c->secretKey = $accessKeySecret;
        $req = new AlibabaAliqinFcSmsNumSendRequest;
        $req->setSmsType("normal");
        $req->setSmsFreeSignName("秘录小典");
        $req->setSmsParam("{\"verify_code\":\"$code\"}");
        $req->setRecNum($phone);
        $req->setSmsTemplateCode("SMS_123455003");
        $res = $c->execute($req);  //res就是阿里大于返回的结果

        return $res;

    }

}